package com.cskaoyan.javase.oop3._1interface._2usecase;

/**
 * 用接口的多继承配合默认方法,实现真正意义上的多继承
 * 仅供了解,除非特别有必要,尽量不要做.
 *
 * @since 14:48
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        A a = new A();
        a.test();
        a.test3();
    }
}

interface IA {
    default void test() {
        System.out.println("ia");
    }
}

interface IB {
    default void test() {
        System.out.println("ib");
    }
}

interface IC {
    default void test3() {
        System.out.println("ic");
    }
}
// com.cskaoyan.javase.oop3._1interface._2usecase.I inherits unrelated defaults for test() from types com.cskaoyan.javase.oop3._1interface._2usecase.IA and com.cskaoyan.javase.oop3._1interface._2usecase.IB
interface I extends IA, IB, IC {
    @Override
    default void test() {
    }
}

class A implements I{}